package com.hlw.hr_man.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hlw.hr_man.Model.EmployeeModel;

public class IsFinanceDeptController extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//得到当前登录用户
				EmployeeModel employee = (EmployeeModel) req.getSession().getAttribute("loginEmployee");
				//得到当前用户的角色id
				int role_id = employee.getRole_id();
				PrintWriter pw = resp.getWriter();
				if (role_id == 3 || role_id == 1) {
					pw.write("1");
				} else {
					pw.write("0");
				}
	}

}
